package Map;
import java.util.*;
public class City {
    public static void main(String[] args) {
        Map<String,List<String>> province = new HashMap<>();

        List<String> list = new ArrayList<>();
        list.add("柳州");
        list.add("桂林");
        list.add("南宁");
        province.put("广西",list);

        list = new ArrayList<>();
        list.add("昆明");
        list.add("曲靖");
        list.add("玉溪");
        province.put("云南",list);
        Scanner sc = new Scanner(System.in);
        while (true){
            System.out.println("欢迎使用城市查询系统");
            Set shengfen = province.keySet();
            for (Object o:shengfen){
                System.out.println(o + "");
            }
            System.out.println();
            System.out.println("请输入省份:");
            String sf = sc.next();
            if(province.containsKey(sf)){
                List<String> l = province.get(sf);
                for (String s:l) {
                    System.out.println(s);
                }
            }else {
                System.out.println("没有这个省份");
            }
        }
    }
}
